package com.trade.module.daq.controller;

import com.trade.module.base.controller.BaseController;
import com.trade.module.daq.service.CollectionRuleService;
import com.trade.common.utils.ResponseBean;
import com.trade.module.daq.entity.CollectRule;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

/**
 * Class Description: 采集规则控制类
 *
 * @Version v1.0 2017/6/21 23:39
 * @JDK version 1.8.0_51
 * @Author zfb
 */
@Controller
@RequestMapping(value = "/daq/collectRule")
public class CollectionRuleController extends BaseController{

    @Autowired
    private CollectionRuleService collectionRuleService;

    /**
     * 创建采集规则
     * @param collectRule 采集规则
     * @return ResponseBean
     * @throws Exception 异常
     */
    @RequestMapping(value = "/save", method = RequestMethod.POST)
    public ResponseBean saveCollectRule(@RequestBody CollectRule collectRule) throws Exception{
        return collectionRuleService.save(collectRule);
    }
}
